package com.android.menu;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.Html;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.TextView;

import com.android.interfata.R;

public class MenuHelpScan extends Activity
{
	@Override
	public void onCreate(Bundle savedInstanceState) 
	{
		super.onCreate(savedInstanceState);		
		setContentView(R.layout.menu_help_scan);
		String scanText0 = "Barcodes suported by Cortrobaie App include UPS, EAN and QR. "
				+ "Barcodes which are not currently suported might not be scanned successfully";
		
		String scanText1 = "Barcode Scanner continuously scans a square region shown on teh screen"
				+ "-- just line up the phone so the barcode is completely inside the viewfinder rectangle: ";
		
		String scanText2 = "<b>Tips:</b> "
				+ "<br/><br/>"
				+ "		* The barcode will be read automatically, a bip sound will play and you'll see the result of the scan <br/>"
				+ "		* If you are having trouble scanning, make sure you hold your phone steady. If the camera is unable to focus, try moving your phone closer or further from the barcode <br/>"
				+ "		* Try to avoid shadow or glare on the barcode";
		
		TextView scan0 = (TextView) findViewById(R.id.menu_help_text0);
		scan0.setText(Html.fromHtml(scanText0));
		TextView scan1 = (TextView) findViewById(R.id.menu_help_text1);
		scan1.setText(Html.fromHtml(scanText1));
		TextView scan2 = (TextView) findViewById(R.id.menu_help_text2);
		scan2.setText(Html.fromHtml(scanText2));
	}
	

	/*     menu      */
    @Override
    public boolean onCreateOptionsMenu(Menu menu) 
    {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.menu, menu);
        
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item)
    {
    	Intent intent;
        switch (item.getItemId()) 
        {
            case R.id.menu_about:     
            	intent = new Intent(getApplicationContext(), MenuAbout.class);
				startActivity(intent);
                break;
            case R.id.menu_help:     
            	intent = new Intent(getApplicationContext(), MenuHelp.class);
				startActivity(intent);
                break;
            case R.id.menu_legal: 
            	intent = new Intent(getApplicationContext(), MenuLegal.class);
				startActivity(intent);
            	break;
            case R.id.menu_contact:
            	intent = new Intent(getApplicationContext(), MenuContact.class);
				startActivity(intent);
            	break;
        }
        return true;
    }
	/*     end menu      */
}
